﻿<%@ Page Title="Club Recreacional TUNQUI" Language="C#" MasterPageFile="~/TunkiFiles/Principal.master" AutoEventWireup="true" CodeFile="PlanificacionClases.aspx.cs" Inherits="TunkiFiles_Planificacion_PlanificacionClases" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    
    <script language="javascript" type="text/javascript">

    function ValidaLongitud(txtControl,maxlength){

        if (txtControl.value.length >= maxlength) {
            window.event.keyCode = 0;
        }
    }

    </script>

    <table style="width: 100%;">
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td style="width: 117px">
                &nbsp;</td>
            <td style="width: 429px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td colspan="2" class="titulo">
                Planificar Clases</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td style="width: 117px">
                &nbsp;</td>
            <td style="width: 429px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td style="width: 117px">
                Instructor</td>
            <td style="width: 429px">
                <asp:DropDownList ID="ddlInstructor" runat="server" AutoPostBack="True" 
                    DataSourceID="odsInstructor" DataTextField="NombreCompleto" 
                    DataValueField="Codigo" 
                    onselectedindexchanged="ddlInstructor_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="odsInstructor" runat="server" 
                    SelectMethod="obtenerInstructors" TypeName="BOAcademias.BOInstructor">
                </asp:ObjectDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td style="width: 117px">
                &nbsp;</td>
            <td style="width: 429px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td class="GridViewAlternatingRowStyle" colspan="2">
                Secciones a Cargo</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td style="width: 117px">
                &nbsp;</td>
            <td style="width: 429px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td colspan="2">
                <asp:GridView ID="gvSeccion" runat="server" AutoGenerateColumns="False" 
                    BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" 
                    CellPadding="4" DataSourceID="odsSeccion" GridLines="Horizontal" 
                    onselectedindexchanged="gvSeccion_SelectedIndexChanged">
                    <RowStyle BackColor="White" ForeColor="#333333" />
                    <Columns>
                        <asp:BoundField DataField="Cod_seccion" HeaderText="Código" 
                            SortExpression="Cod_seccion" />
                        <asp:BoundField DataField="Des_seccion" HeaderText="Descripción" 
                            SortExpression="Des_seccion" />
                        <asp:CommandField ButtonType="Button" HeaderText="Planificar Clases" 
                            SelectText="Planificar Clases" ShowSelectButton="True" />
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#333333" />
                    <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
                <asp:ObjectDataSource ID="odsSeccion" runat="server" 
                    SelectMethod="obtenerSeccionesActivasxInstructor" 
                    TypeName="DAOAcademias.DOSeccion">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlInstructor" Name="codInstructor" 
                            PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td colspan="2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td colspan="2" class="GridViewAlternatingRowStyle">
                Clases Programadas</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td colspan="2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 33px">
                &nbsp;</td>
            <td colspan="2">
                <asp:DataList ID="dtlClases" runat="server" BackColor="White" 
                    BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" 
                    DataSourceID="odsClases" GridLines="Horizontal" Visible=false
                    onupdatecommand="dtlClases_UpdateCommand" 
                    onselectedindexchanged="dtlClases_SelectedIndexChanged" RepeatColumns="2" 
                    RepeatDirection="Horizontal">
                    <FooterStyle BackColor="White" ForeColor="#333333" />
                    <ItemStyle BackColor="White" ForeColor="#333333" />
                    <SelectedItemStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                    <ItemTemplate>
                   
                        <table style="width: 100%;" >
                        <tr>
                            <td style="width: 33px">
                                &nbsp; </td>
                            <td>
                                 <asp:Label ID="lblCodClase" runat="server" Visible="False" 
                                     Text='<%# Eval("Cod_Clase") %>' /></td>
                            <td>
                                 &nbsp;</td>
                        </tr>
                        <tr>
                            <td style="width: 33px">
                                Fecha:</td>
                            <td>
                                 <asp:Label ID="lblFecha" runat="server" 
                                    Text='<%# Eval("Fecha", "{0:d}") %>' /></td>
                            <td>
                                Repetir  para :</td>
                        </tr>
                        <tr>
                            <td style="width: 33px">
                                Recurso:</td>
                            <td>
                                 <asp:TextBox ID="txtRecurso" runat="server" Text='<%# Eval("Recurso") %>'  Enabled='<%# Eval("Pendiente") %>' 
                            Rows="5" TextMode="MultiLine" MaxLength="100" onkeypress="ValidaLongitud(this,100);" onpaste="return false;"  />
                                 <asp:FilteredTextBoxExtender ID="txtRecurso_FilteredTextBoxExtender" 
                                     runat="server" TargetControlID="txtRecurso"
                                     ValidChars="<%$ AppSettings:ValidaCadena %>" Enabled="True">
                                 </asp:FilteredTextBoxExtender>
                            </td>
                            <td>
                                <table><tr><td><asp:Button ID="btnSemana" runat="server" onclick="btnSemana_Click"  
                                        Text="Semana" Enabled='<%# Eval("Pendiente") %>' Width="70"/></td></tr>
                                <tr><td><asp:Button ID="btnMes" runat="server" onclick="btnMes_Click" Text="Mes" 
                                        Enabled='<%# Eval("Pendiente") %>' Width="70" /></td></tr>
                                <tr><td><asp:Button ID="btnPeriodo" runat="server" onclick="btnPeriodo_Click" 
                                        Text="Periodo" Enabled='<%# Eval("Pendiente") %>' Width="70" /></td></tr></table> </td>
                        </tr>
                       
                       
                       </table>
                       
                    </ItemTemplate>
                </asp:DataList>
                <asp:ObjectDataSource ID="odsClases" runat="server" 
                    SelectMethod="obtenerClasesXSeccion" TypeName="BOAcademias.BOClase">
                    <SelectParameters>
                        <asp:SessionParameter Name="seccion" SessionField="codSeccion" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <table style="width:100%;">
                    <tr>
                        <td style="width: 147px">
                <asp:Button ID="btnGuardar" runat="server" onclick="btnGuardar_Click" 
                    Text="Guardar" Visible=false />
                        </td>
                        <td>
                            <asp:Button ID="btnCancelar" runat="server" Text="Regresar" 
                                onclick="btnCancelar_Click" Visible=false/>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 147px">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 147px">
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

